package com.nondo.dean.auth.service.impl;

import com.nondo.dean.auth.domain.UserAuthorityExample;
import com.nondo.dean.auth.domain.UserAuthorityKey;
import com.nondo.dean.auth.mapper.UserAuthorityMapper;
import com.nondo.dean.auth.service.UserAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author linfeng
 */
@Service
public class UserAuthorityServiceImpl implements UserAuthorityService {

    @Autowired
    private UserAuthorityMapper userAuthorityMapper;

    @Override
    public List<UserAuthorityKey> findByUserId(Long userId) {
        UserAuthorityExample example = new UserAuthorityExample();
        example.createCriteria().andUserIdEqualTo(userId);
        return userAuthorityMapper.selectByExample(example);
    }

}
